<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用不同参数调用函数</title>
</head>

<body>
    <p>请点击其中的一个按钮，来调用带参数的函数。</p>
    <button onclick="myFunction('Harry Potter','Wizard')">点击这里</button>
    <button onclick="myFunction('Bob','Builder')">点击这里</button>
    <script>
        function myFunction(name, job) {
            alert("welcome" + name + ", the " + job);
        }
    </script>
</body>

</html>